/**
 * 
 */
package org.wadael.waverobotfrmwrk.simple;

// import org.mortbay.log.Log;
import org.wadael.waverobotfrmwrk.WadRobot;
import org.wadael.waverobotfrmwrk.utils.BlipUtils;

import com.google.wave.api.Blip;
import com.google.wave.api.event.Event;
import com.google.wave.api.impl.EventMessageBundle;

/**
 * @author jerome
 *
 */
@SuppressWarnings("serial")
public abstract class BlipModifierRobot extends WadRobot {

	/* (non-Javadoc)
	 * @see org.wadael.waverobotfrmwrk.WadRobot#reactToSubmittedBlip(com.google.wave.api.impl.EventMessageBundle, com.google.wave.api.Blip, com.google.wave.api.event.Event)
	 */
	@Override
	protected void reactToSubmittedBlip(EventMessageBundle bundle, Blip blip, Event event) {
//		Log.debug("IN modifier reactToSubmittedBlip");  // TODO remove
//		Log.debug(  BlipUtils.getEventBlipText(event)  ); // TODO remove
		BlipUtils.replaceBlipContent(event.getBlip(), modifyBlipText( BlipUtils.getEventBlipText(event) )  ) ;
	}
	
	/**
	 *	Abstract method you have to implement. 
	 * 
	 * @param actualText the current value of the text in the blip 
	 * @return some other text, to be modified/appended by YOUR code 
	 * OR NULL if you do not want to perform any modification
	 */
	protected abstract String modifyBlipText(String actualText) ;

	
	

}
